<div>
  <em>
    <%= t("projects.reports.elements.modals.project_contents_inner.instructions") %>
  </em>
</div>

<% if project.project_my_modules.active.exists? %>
  <div class="checkbox-tree">
    <ul>
      <li>
        <%= form.check_box :project, label: project.name %>
        <ul>

          <% project.experiments.includes(:my_module_groups).active.each do |experiment| %>
            <% next unless experiment.my_modules.active.exists? %>
            <li>
              <%= form.check_box "experiment_#{experiment.id}", label: experiment.name %>
              <ul>

                <% experiment.my_module_groups.each do |my_module_group| %>
                  <% my_module_group.my_modules.workflow_ordered.active.each do |my_module| %>
                    <li>
                      <%= form.check_box "modules[#{my_module.id}]", label: my_module.name %>
                    </li>
                  <% end %>
                <% end %>

                <!-- Tasks without groups -->
                <% experiment.my_modules.without_group.each do |my_module| %>
                  <li>
                    <%= form.check_box "modules[#{my_module.id}]", label: my_module.name %>
                  </li>
                <% end %>

              </ul>
            </li>
          <% end %>

        </ul>
      </li>
    </ul>
  </div>
<% else %>
  <div>
    <em>
      <%= t("projects.reports.elements.modals.project_contents_inner.no_modules") %>
    </em>
  </div>
<% end %>
